Segment Algorithm
The Segment algorithm partitions the string to be masked into one or more segments and then masks each segment separately. Each segment is defined as either a numeric or alphanumeric. The characters in each field are replaced using a deterministic variable algorithm.
Algorithm Characteristics
- Algorithm: Segment
- Masking Technique: Anonymization
- Supported Types: String
- Referential Integrity: true
- Conflict-free: false
- Realistic Data: true
- Reversible: false
Properties
-
ignoreChars {
list[string]
; optional; default:[ "-", "_", ".", ",", " " ]
}
A list of characters to ignore while masking. When determining segments, these characters are not considered when calculating length or positions.
Example:"ignoreChars": [ "-", " " ]
-
segments {
list[segmentInfo objects]
; required }
A list of the segmentInfo objects which describe how to mask each segment
Example:"segments": [
{
"type": "Preserve",
"length": 3,
},
{
"type": "Numeric",
"length": 3,
"original": {
"minNum": 000,
"maxNum": 999,
},
"masked": {
"minNum": 000,
"maxNum": 499
}
}
]-
segmentInfo object {
object
; required }
An object whose properties control how a segment is masked.-
type {
enum
; optional; default:Preserve
}
One ofPreserve
,Numeric
, orAlphaNumeric
.Preserve
segments are not modified during masking.Numeric
segements are composed of digits and are masked according to the segment's properties.AlphanNumeric
segments aer composed of letters and digits and are masked according to the segment's properties.
Example:"type": "Preserve"
-
length {
enum
; required; default: ``}
The number of character in the segment.ignoreChars
are not included in the length count.
Example:"length": 3
-
original {
characterSet object
; optional; default:0-9,A-Z
}
Defines the characters allowed to occur in the segment. Characters that are not in the defined set are not masked.
Example:"original": {
"minNum": 0,
:maxNum": 900
} -
masked {
characterSet object
; optional; default:0-9,A-Z
}
Defines the range characters that the original segment characters will be masked to.
Example:"masked": {
"minNum": 100,
:maxNum": 999
}-
characterSet object {
object
; required }
An object whose properties define a range of Numeric or AlphaNumeric characters.-
minNum {
int
; optional; default:0
}
The smallest positive digit orint
allowed in this segment.
Example:"minNum": 1
-
maxNum {
int
; optional; defaultNumeric: max int oflength
digits; defaultAlphaNumeric:9
}
The largest positive digit orint
allowed in this segment.
Example:"minNum": 1
-
minChar {
char
; optional; default:"A"
}
The minimum ordinal character allowed in this segment.
Example:"minChar": "A"
-
maxChar {
char
; optional; default:"Z"
}
The maximum ordinal character allowed in this segment.
Example:"maxChar": "Z"
-
range {
string
; optional; default:"Z"
}
A comma seperated list of ranges for numbers or characters allowed in this segment. If you would like to just use the range to define the allowed characters, the min and max attributes must be set to define an empty set. This can be accomplished by setting the min greater than the max.
Example:"range": "A-F,0-9"
-
-
-
-
Example JSON configuration
{
"name": "ExampleSegmentMasker",
"description": "Masks .",
"algorithm": "Segment",
"numSegments": 3,
"ignoreChars": [ "-", " " ]
"segments\": [
{
"type": "Preserve",
"length": 3
},
{
"type": "AlphaNumeric",
"length": 3
"MinChar": "A"
"MaxChar": "F"
}
{
"type": "Numeric",
"length": 3
}
]
}